import com.dafeng.www.TestDemo;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-05-13
 * Time: 15:26
 */
public class Student {//定义一个类：class + 类名
    private int age;
    private String name;

    private static int id;

    String stuNum;

    public Student(int age, String name, String stuNum) {
        this.age = age;
        this.name = name;
        this.stuNum = stuNum;
    }

    public static void main(String[] args) {
        Student stu1 = new Student(18,"zhang san","20230502107");
        Student stu2 = new Student(18,"li si","20230502108");

        Student.id = 1;

        Student stu3 = null;
        stu3.id = 2;//说明类变量不依赖于对象
        System.out.println(Student.id);
    }
}
